import request from "@/config/axios";

// 请求数据
export const roleTableData = (data)=>request(
    {
        url:`http://localhost:8080/jeecg-boot/sys/role/list?&pageNo=${data.pageNo}&pageSize=${data.pageSize}&roleName=${data.roleName}&order=desc`,//请求的地址
        method:"GET"
    }
)

// 请求右侧表数据
export const roleTableDataAdd = (data)=>request(
    {
        url:`http://localhost:8080/jeecg-boot/sys/user/userRoleList?&pageNo=${data.pageNo}&pageSize=${data.pageSize}&roleId=${data.roleId}&order=desc`,//请求的地址
        method:"GET"
    }
)

// 增加table表数据
export const addTableData = (data)=>request(
    {
        url:`http://localhost:8080/jeecg-boot/sys/role/add`,//请求的地址
        method:"POST",
        data
    }
)
// 删除table表数据
export const delTableData = (data)=>request(
    {
        url:`http://localhost:8080/jeecg-boot/sys/role/delete?id=${data.id}`,//请求的地址
        method:"DELETE",
        
    }
)

// 获得树结构
export const treeData = ()=>request(
    {
        url:`http://localhost:8080/jeecg-boot/sys/role/queryTreeList`,//请求的地址
        method:"GET",
        
    }
)

// 获得树结构许可，具体选中情况
export const treeDataSelected = (data)=>request(
    {
        url:`http://localhost:8080/jeecg-boot/sys/permission/queryRolePermission?roleId=${data.roleId}`,//请求的地址
        method:"GET",
        
    }
)
// 获得树结构许可，具体选中情况
export const saveDrawerAuthor = (data)=>request(
    {
        url:`http://localhost:8080/jeecg-boot/sys/permission/saveRolePermission`,//请求的地址
        method:"POST",
        data
        
    }
)








